package com.pxml2pdf.pdf;

import com.pxml2pdf.pdf.Node.BaseNode;
import com.pxml2pdf.pdf.Node.ButtonNode;
import com.pxml2pdf.pdf.Node.CheckBoxNode;
import com.pxml2pdf.pdf.Node.DivNode;
import com.pxml2pdf.pdf.Node.LabelNode;
import com.pxml2pdf.pdf.Node.LiLabelNode;
import com.pxml2pdf.pdf.Node.RadioNode;
import com.pxml2pdf.pdf.Node.TextNode;
import com.pxml2pdf.pdf.Node.XgridNode;

public final class NodeFactory {
	private static final String TEXT = "text";
	private static final String LABEL = "label";
	private static final String RADIO = "radio";
	private static final String BUTTON = "button";
	private static final String LI_LABEL = "liLabel";
	public static final String DIV = "div";
	public static final String XGRID = "xgrid";
	private static final String CHECK_BOX = "checkBox";
	

	public static BaseNode createNode(String nodeType) {
		if (TEXT.equals(nodeType)) {
			return new TextNode();
		} else if (LABEL.equals(nodeType)) {
			return new LabelNode();
		} else if (RADIO.equals(nodeType)) {
			return new RadioNode();
		} else if (BUTTON.equals(nodeType)) {
			return new ButtonNode();
		} else if (LI_LABEL.equals(nodeType)) {
			return new LiLabelNode();
		} else if (DIV.equals(nodeType)) {
			return new DivNode();
		} else if (XGRID.equals(nodeType)) {
			return new XgridNode();
		} else if (CHECK_BOX.equals(nodeType)){
			return new CheckBoxNode();
		}
		return null;
	}

}
